package com.example.blog.modules.article.dto;

import com.example.blog.common.validation.DateRange;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Set;

@Data
public class ArticleDTO {
    private Long id;

    @NotBlank(message = "文章标题不能为空")
    @Size(max = 100, message = "标题长度不能超过100")
    private String title;

    @NotBlank(message = "文章内容不能为空")
    private String content;

    @Size(max = 500, message = "摘要长度不能超过500")
    private String summary;

    @Size(max = 255, message = "封面图片URL长度不能超过255")
    private String coverImage;

    private String status;
    private Boolean isPublished;
    private Boolean isRecommended;
    private Boolean isOriginal;
    private Boolean isTop;
    private Boolean allowComment;

    @Size(max = 255, message = "来源URL长度不能超过255")
    private String sourceUrl;

    private Long viewCount;
    private Long likeCount;
    private Long commentCount;
    private Long authorId;
    private String authorName;
    private String authorAvatar;
    private Set<String> tags;
    private Set<String> categories;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
} 